package com.mingqijia.gassafety.db.mapper;

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mingqijia.gassafety.db.entity.RunningRecord;
import com.mingqijia.gassafety.db.entity.vo.DisposeRecordResponseVO;
import com.mingqijia.gassafety.db.entity.vo.DisposeRecordVO;
import com.mingqijia.gassafety.db.entity.WarningRecord;
import com.mingqijia.gassafety.db.entity.vo.WarningRecodeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;


/**
 * <p>
 * 预警记录 Mapper 接口
 * </p>
 *
 * @author zhangfei
 * @since 2022-03-08
 */
@Mapper
@Repository
public interface WarningRecordMapper extends BaseMapper<WarningRecord> {

    List<WarningRecord> selectContents(@Param("dateTime") DateTime dateTime,
                                       @Param("spId") String spId);

    List<WarningRecodeVO> selectCountList(@Param("startTimeBeginning")Date startTimeBeginning, @Param( "startTimeEnd" ) Date startTimeEnd,
                                          @Param( "warningStartTimeBeginning") Date warningStartTimeBeginning, @Param( "warningStartTimeEnd" )Date warningStartTimeEnd,
                                          @Param( "consumerIds" ) List<Integer> consumerIds, @Param( "strategyIds" ) List<Long> strategyIds,
                                          @Param( "type" )String type, @Param( "status" )Integer status, @Param( "spId" ) String spId
            , @Param( "imei" ) String imei);

    List<WarningRecord> selectLists(@Param( "date" )  String date);

    int selectWarnStrategyUse(@Param("id")Long id);

    List<WarningRecord> selectCallLists();

    void updateByTaskDataId(@Param("taskDataId")String taskDataId,
                            @Param("code")int code,@Param("desc") String desc);

    List<DisposeRecordResponseVO> getList(DisposeRecordVO vo);



}
